//
//  PhysicObject.h
//  Box2dDemo
//
//  Created by Thi Huynh on 9/6/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "cocos2d.h"
#import "Box2D.h"
#import "AbstractLayer.h"

@interface PhysicObject : NSObject
{
    CCSprite        *_objectSprite;
    b2Body          *_objectBody;
    b2Shape         *_objectShape;
    AbstractLayer   *_parentLayer;
    
    NSString *_name;
    CGPoint  _pos;
    CGPoint  _direction;
    int      _tag;
    float    _scale;
}

@property(nonatomic, retain)   CCSprite         *objectSprite;
@property(nonatomic, readonly) b2Body           *objectBody;
@property(nonatomic, assign)   AbstractLayer    *parentLayer;
@property(nonatomic, retain)   NSString         *name;
@property(nonatomic)           CGPoint          pos;
@property(nonatomic)           CGPoint          direction;
@property(nonatomic)           int              tag;
@property(nonatomic)           float            scale;


- (id)initObjectWithWorld:(b2World*)world pos:(CGPoint)pos imgPath:(NSString*)imgPath;
- (void)setTransformPos:(CGPoint)point;
- (void)setTransformRot:(float)angle;
- (void)startUp;
- (void)createSpriteWithFileName:(NSString*)fileName;
- (void)createBodyWith:(b2World*)world;
- (void)update:(ccTime)dt;

@end
